#include<stdio.h>

void sellTickets(int thread,int numOftickets){
	while(numOftickets>0){
		numOftickets--;
		printf("%d thread sell a ticket.\n",thread);
	}
	printf("%d thread down\n",thread);
}

int main(){
	int thread = 10;
	int numTickets = 150;
	InitThreadPackage(false);
	for(int agent=1,agent<=thread;agent++){
		char name[32];
		sprintf(name,"agent %d",agent);
		ThreadNew(agent,sellTickets,2,agent,numTickets/thread);
	}
	RunAllThread();
	return 0;
}
